# example data
for index, row in id_rms_df.iterrows():
fig, ax = plt.subplots(figsize=(10,4))
# the histogram of the data
n, bins, patches = ax.hist(row['rms'], num_bins, density=1, edgecolor='black', linewidth=1.2)
bin_centers = 0.5 * (bins[1:] + bins[:-1])
ax.plot(bin_centers, n, color='red') ## using bin_centers rather than edges
ax.set_xlabel(' -- RMSD -- ')
ax.set_ylabel(' -- Frequency -- ')
ax.set_title('RMS Distribution of ' + row['seq1'])
ax.text(2.3, 16, 'Sequence: ' + row['seq1'], style='italic',
bbox={'facecolor':'red', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 13, 'Skew: ' + str(skew(row['rms']))[:8], style='italic',
bbox={'facecolor':'yellow', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 10, 'Kurtosis: ' + str(kurtosis(row['rms']))[:8], style='italic',
bbox={'facecolor':'lightblue', 'alpha': 0.5, 'pad':10})
ax.set_xticks(x_x)
ax.set_yticks(y_y)
# Tweak spacing to prevent clipping of ylabel
fig.tight_layout()
plt.show()